x86: Don't use potentially incorrect CPUID values for topology information
authorJan H. Schönherr <jschoenh@amazon.de>
Sun, 7 Jan 2018 20:28:20 +0000 (12:28 -0800)
committerAndrew Cooper <andrew.cooper3@citrix.com>
Mon, 8 Jan 2018 10:48:24 +0000 (10:48 +0000)
commitd51baf310e530659f73e714acf575555bdc46303
tree68c8c294c7da1abfb7b238bf2fa18e79514de6dd
parent2d1c82261d966735e82e5971eddb63ba3c565a37
x86: Don't use potentially incorrect CPUID values for topology information

Intel says for CPUID leaf 0Bh:

  "Software must not use EBX[15:0] to enumerate processor
   topology of the system. This value in this field
   (EBX[15:0]) is only intended for display/diagnostic
   purposes. The actual number of logical processors
   available to BIOS/OS/Applications may be different from
   the value of EBX[15:0], depending on software and platform
   hardware configurations."

And yet, we're using them to derive the number cores in a package
and the number of siblings in a core.

Derive the number of siblings and cores from EAX instead, which is
intended for that.

Signed-off-by: Jan H. Schönherr <jschoenh@amazon.de>
Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
xen/arch/x86/cpu/common.c